package 集合;

import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.ConcurrentHashMap;

public class 线程安全的Map {
    public static void main(String[] args) {
        Map<String, String> map = new HashMap<>();
        map.put("","");
        // SynchronizedMap 静态代理模式 持有了一个传入的map,然后对this加锁
        Map<String, String> synchronizedMap = Collections.synchronizedMap(new HashMap<>());
        Map<String, String> concurrentHashMap = new ConcurrentHashMap<>();
        int size = concurrentHashMap.size();

        LinkedHashMap<String, Object> linkedHashMap = new LinkedHashMap<>();

        Hashtable<String, Object> hashtable = new Hashtable<>();

        TreeMap<String, Object> treeMap = new TreeMap<>();

    }
}
